<%@ page pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="inc/taglib.jsp"%>

<c:set scope="request" var="IGNORE_APP_JS" value="${ true }" />
<c:set scope="request" var="APPEND_TO_HEAD" value="${ true }" />

<dx:skipPageIf test="${ INCLUDE_TO_HEAD }">
	<script><%@ include file="login.js"%></script>
</dx:skipPageIf>

<dx:skipPageIf test="${ ! LAYOUT_INCLUDED }"><jsp:include page="inc/layout_login.jsp" /></dx:skipPageIf>

<h3>${APP_NAME}</h3>
<form action="./login" id="login-form" method="POST" class="login-form" autocomplete="off">
	<div class="form-group">
		<label for="loginName">账号 Account：</label>
		<div class="input-group">
			<span class="input-group-addon"><i class="fa fa-user fa-2"></i></span> <input id="login-form-username" type="text" placeholder="账号" id="loginName" name="loginName"
				class="form-control form-control-solid" data-rule="账号: required">
		</div>
	</div>
	<div class="form-group">
		<label for="loginPasswd">密码 Password：</label>
		<div class="input-group">
			<span class="input-group-addon"><i class="fa fa-lock fa-2"></i></span> <input id="login-form-password" type="password" placeholder="密码" id="loginPasswd" name="loginPasswd"
				class="form-control form-control-solid" data-rule="密码: required;length(6~16)" autocomplete="${ 'new-password' }">
		</div>
		<br>
		<button id="login-form-submit" type="submit" class="btn btn-block btn-success">登录</button>
	</div>
</form>
<div class="copyright">
	Version ${DELONIX_VERSION}<br> Copyright
	<fmt:formatDate value="<%=new java.util.Date()%>" pattern="yyyy" />
	&copy; ${APP_COMPANY}
</div>

<div class="modal" data-backdrop="static" id="login-success-dialog">
	<div class="modal-dialog">
		<div class="modal-content modal-sm">
			<div class="modal-header">
				<h4 class="modal-title">登录成功</h4>
			</div>
			<div class="modal-body">正在跳转...</div>
		</div>
	</div>
</div>

<div class="modal" id="login-error-dialog">
	<div class="modal-dialog">
		<div class="modal-content modal-sm">
			<div class="modal-header">
				<h4 class="modal-title">登录失败</h4>
			</div>
			<div class="modal-body text-danger" id="error-container"></div>
		</div>
	</div>
</div>